home *** CD-ROM | disk | FTP | other *** search
- XML.prototype.ignoreWhite = true;
- XMLNode.prototype.byID = function(id)
- {
- var _loc3_ = this.childNodes.length;
- var _loc1_ = 0;
- while(_loc1_ < _loc3_)
- {
- var _loc2_ = this.childNodes[_loc1_];
- if(_loc2_.attributes.id == id)
- {
- return _loc2_;
- }
- _loc1_ = _loc1_ + 1;
- }
- return null;
- };
- XMLNode.prototype.byName = function(name)
- {
- var _loc3_ = this.childNodes.length;
- var _loc1_ = 0;
- while(_loc1_ < _loc3_)
- {
- var _loc2_ = this.childNodes[_loc1_];
- if(_loc2_.nodeName == name)
- {
- return _loc2_;
- }
- _loc1_ = _loc1_ + 1;
- }
- return null;
- };
- XMLNode.prototype.byIndex = function(index)
- {
- if(this.childNodes[index])
- {
- return this.childNodes[index];
- }
- return null;
- };
- XMLNode.prototype.getText = function()
- {
- return this.firstChild.nodeValue;
- };
- XMLNode.prototype.byPath = function(path)
- {
- var _loc1_ = this;
- var arrPath = path.split("/");
- var len = arrPath.length;
- var _loc3_ = 0;
- while(_loc3_ < len)
- {
- var _loc2_ = arrPath[_loc3_];
- if(_loc2_.charAt(0) == "@")
- {
- _loc1_ = _loc1_.byID(_loc2_.substring(1));
- }
- else if(_loc2_.charAt(0) == "#")
- {
- _loc1_ = _loc1_.byIndex(parseInt(_loc2_.substring(1)));
- }
- else
- {
- _loc1_ = _loc1_.byName(_loc2_);
- }
- if(!_loc1_)
- {
- }
- _loc3_ = _loc3_ + 1;
- }
- return _loc1_;
- };
- ASSetPropFlags(XML.prototype,"byID,byName,byIndex,byPath,getText",1);
-